//
//  FenLeiCollectionView.m
//  firstpoint
//
//  Created by 泽中 on 2017/7/5.
//  Copyright © 2017年 xzcysoft. All rights reserved.
//

#import "FenLeiCollectionView.h"
#import "FenLeiCollectionViewCell.h"
#import "CommodityDetailsViewController.h"
#import "ShoppingFenLeiViewController.h"
@implementation FenLeiCollectionView
-(instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout
{
    self = [super initWithFrame:frame collectionViewLayout:layout];
    if (self){
        _numArr=[NSMutableArray new];
        [_numArr addObjectsFromArray:@[@"1",@"2",@"3"]];
        self.delegate=self;
        self.dataSource=self;
        [self registerClass:[FenLeiCollectionViewCell class] forCellWithReuseIdentifier:@"cell"];
        
    }
    return self;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return _dataArr.count;
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    FenLeiCollectionViewCell *cell = (FenLeiCollectionViewCell *)[collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
    cell.backgroundColor = [UIColor lightGrayColor];
    cell.lab.text =_dataArr[indexPath.row][@"name"];
    return cell;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
